import { request } from '@/http/axios';
import { IBase, IRecords } from '../app';

export interface IReader extends IBase {
  id?: number;
  identifier: string;
  readerName: string;
  remark: string;
}

function records(data) {
  return request<IRecords<IReader>>({
    url: '/reader/records',
    method: 'POST',
    data
  });
}

function upgrade(data) {
  return request({
    url: '/reader/upgrade',
    method: 'POST',
    data
  });
}

function del(id) {
  return request({
    url: '/reader/del',
    method: 'GET',
    params: {
      id
    }
  });
}

export const readerModel = {
  records,
  upgrade,
  del
};
